import request from '@/utils/request'

// 查询客户收益列表
export function listFund(query) {
  return request({
    url: '/prod-api/customer/fund/list',
    method: 'get',
    params: query
  })
}

// 查询客户收益详细
export function getFund(fundUid) {
  return request({
    url: '/prod-api/customer/fund/' + fundUid,
    method: 'get'
  })
}

// 新增客户收益
export function addFund(data) {
  return request({
    url: '/prod-api/customer/fund',
    method: 'post',
    data: data
  })
}

// 修改客户收益
export function updateFund(data) {
  return request({
    url: '/prod-api/customer/fund',
    method: 'put',
    data: data
  })
}

// 删除客户收益
export function delFund(fundUid) {
  return request({
    url: '/prod-api/customer/fund/' + fundUid,
    method: 'delete'
  })
}

//查看客户总收益
export function getCustomerProfit(query) {
  return request({
    url: '/prod-api/customer/fund/getAllProfit',
    method: 'get',
    params: query
  })
}

/**
 * 根据id查询一级粉丝信息
 */
export function getFreeCustomerInfo(customerUid) {
  return request({
   url: '/prod-api/customer/fund/getFreeCustomerInfo/' + customerUid,
    method: 'get'
  })
}

/**
 * 根据id查询二级粉丝信息
 */
export function getFreeSecondCustomerInfo(customerUid) {
  return request({
   url: '/prod-api/customer/fund/getFreeSecondCustomerInfo/' + customerUid,
    method: 'get'
  })
}

// 扣除资产
export function deduct(data) {
  return request({
    url: '/prod-api/customer/fund/deduct',
    method: 'post',
    data: data
  })
}
